<?php
/**
 * Created by PhpStorm.
 * User: lufficc
 * Date: 2016/9/17
 * Time: 17:10
 */

namespace Lufficc;
use Config;

class FileUploadManager
{

    public function uploadFile($key, $filePath)
    {
        OSS::upload($key,$filePath,Config::get('oss.IsOssServer'));
        $url = OSS::getUrl($key);
        $url = substr($url,0,strpos($url,'?'));
        $url =urldecode($url);
        return $url;
    }

    public function deleteFile($key)
    {
        //删除图片
        if ('' == null) {
            return false;
        } else {
            return true;
        }
    }
}